package com.example.rain.answer;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class otherActivity extends AppCompatActivity {

    private Intent intent;
    private Bundle bundle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.other);
        Bundle bunde = this.getIntent().getExtras();
        String ans = bunde.getString("ans");
        String sexText = "";
        if(ans.equals("in")){
            sexText = "正确";
        }
        else
        {
            sexText = "错误";
        }
        TextView tv1 = (TextView)findViewById(R.id.text1);
        tv1.setText("你选择的答案是"+sexText);

        Button btn3_back = (Button)findViewById(R.id.button_back);
        btn3_back.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v){
                otherActivity.this.setResult(RESULT_OK,intent);
                otherActivity.this.finish();
            }
        });

    }
}
